/*
 * Copyright (c) 2023 vitasystems GmbH
 *
 * This file is part of project EHRbase Migration Tool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehrbase.migration.exporter.v0.jooq.pg.udt.records;

import org.ehrbase.migration.exporter.v0.jooq.pg.udt.DvCodedText;
import org.jooq.Field;
import org.jooq.Record6;
import org.jooq.Row6;
import org.jooq.impl.UDTRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class DvCodedTextRecord extends UDTRecordImpl<DvCodedTextRecord>
        implements Record6<String, CodePhraseRecord, String, CodePhraseRecord, CodePhraseRecord, String[]> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for <code>ehr.dv_coded_text.value</code>.
     */
    public void setValue(String value) {
        set(0, value);
    }

    /**
     * Getter for <code>ehr.dv_coded_text.value</code>.
     */
    public String getValue() {
        return (String) get(0);
    }

    /**
     * Setter for <code>ehr.dv_coded_text.defining_code</code>.
     */
    public void setDefiningCode(CodePhraseRecord value) {
        set(1, value);
    }

    /**
     * Getter for <code>ehr.dv_coded_text.defining_code</code>.
     */
    public CodePhraseRecord getDefiningCode() {
        return (CodePhraseRecord) get(1);
    }

    /**
     * Setter for <code>ehr.dv_coded_text.formatting</code>.
     */
    public void setFormatting(String value) {
        set(2, value);
    }

    /**
     * Getter for <code>ehr.dv_coded_text.formatting</code>.
     */
    public String getFormatting() {
        return (String) get(2);
    }

    /**
     * Setter for <code>ehr.dv_coded_text.language</code>.
     */
    public void setLanguage(CodePhraseRecord value) {
        set(3, value);
    }

    /**
     * Getter for <code>ehr.dv_coded_text.language</code>.
     */
    public CodePhraseRecord getLanguage() {
        return (CodePhraseRecord) get(3);
    }

    /**
     * Setter for <code>ehr.dv_coded_text.encoding</code>.
     */
    public void setEncoding(CodePhraseRecord value) {
        set(4, value);
    }

    /**
     * Getter for <code>ehr.dv_coded_text.encoding</code>.
     */
    public CodePhraseRecord getEncoding() {
        return (CodePhraseRecord) get(4);
    }

    /**
     * Setter for <code>ehr.dv_coded_text.term_mapping</code>.
     */
    public void setTermMapping(String[] value) {
        set(5, value);
    }

    /**
     * Getter for <code>ehr.dv_coded_text.term_mapping</code>.
     */
    public String[] getTermMapping() {
        return (String[]) get(5);
    }

    // -------------------------------------------------------------------------
    // Record6 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row6<String, CodePhraseRecord, String, CodePhraseRecord, CodePhraseRecord, String[]> fieldsRow() {
        return (Row6) super.fieldsRow();
    }

    @Override
    public Row6<String, CodePhraseRecord, String, CodePhraseRecord, CodePhraseRecord, String[]> valuesRow() {
        return (Row6) super.valuesRow();
    }

    @Override
    public Field<String> field1() {
        return DvCodedText.VALUE;
    }

    @Override
    public Field<CodePhraseRecord> field2() {
        return DvCodedText.DEFINING_CODE;
    }

    @Override
    public Field<String> field3() {
        return DvCodedText.FORMATTING;
    }

    @Override
    public Field<CodePhraseRecord> field4() {
        return DvCodedText.LANGUAGE;
    }

    @Override
    public Field<CodePhraseRecord> field5() {
        return DvCodedText.ENCODING;
    }

    @Override
    public Field<String[]> field6() {
        return DvCodedText.TERM_MAPPING;
    }

    @Override
    public String component1() {
        return getValue();
    }

    @Override
    public CodePhraseRecord component2() {
        return getDefiningCode();
    }

    @Override
    public String component3() {
        return getFormatting();
    }

    @Override
    public CodePhraseRecord component4() {
        return getLanguage();
    }

    @Override
    public CodePhraseRecord component5() {
        return getEncoding();
    }

    @Override
    public String[] component6() {
        return getTermMapping();
    }

    @Override
    public String value1() {
        return getValue();
    }

    @Override
    public CodePhraseRecord value2() {
        return getDefiningCode();
    }

    @Override
    public String value3() {
        return getFormatting();
    }

    @Override
    public CodePhraseRecord value4() {
        return getLanguage();
    }

    @Override
    public CodePhraseRecord value5() {
        return getEncoding();
    }

    @Override
    public String[] value6() {
        return getTermMapping();
    }

    @Override
    public DvCodedTextRecord value1(String value) {
        setValue(value);
        return this;
    }

    @Override
    public DvCodedTextRecord value2(CodePhraseRecord value) {
        setDefiningCode(value);
        return this;
    }

    @Override
    public DvCodedTextRecord value3(String value) {
        setFormatting(value);
        return this;
    }

    @Override
    public DvCodedTextRecord value4(CodePhraseRecord value) {
        setLanguage(value);
        return this;
    }

    @Override
    public DvCodedTextRecord value5(CodePhraseRecord value) {
        setEncoding(value);
        return this;
    }

    @Override
    public DvCodedTextRecord value6(String[] value) {
        setTermMapping(value);
        return this;
    }

    @Override
    public DvCodedTextRecord values(
            String value1,
            CodePhraseRecord value2,
            String value3,
            CodePhraseRecord value4,
            CodePhraseRecord value5,
            String[] value6) {
        value1(value1);
        value2(value2);
        value3(value3);
        value4(value4);
        value5(value5);
        value6(value6);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached DvCodedTextRecord
     */
    public DvCodedTextRecord() {
        super(DvCodedText.DV_CODED_TEXT);
    }

    /**
     * Create a detached, initialised DvCodedTextRecord
     */
    public DvCodedTextRecord(
            String value,
            CodePhraseRecord definingCode,
            String formatting,
            CodePhraseRecord language,
            CodePhraseRecord encoding,
            String[] termMapping) {
        super(DvCodedText.DV_CODED_TEXT);

        setValue(value);
        setDefiningCode(definingCode);
        setFormatting(formatting);
        setLanguage(language);
        setEncoding(encoding);
        setTermMapping(termMapping);
        resetChangedOnNotNull();
    }
}
